home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / sunrpc / rpc.man < prev    next >
Encoding:
Text File  |  1989-03-16  |  41.1 KB  |  991 lines

  1.  
  2.  
  3.  
  4. RPC                   C Library Procedures                    RPC
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      rpc - library routines for remote procedure calls
  10.  
  11. SSYYNNOOPPSSIISS AANNDD DDEESSCCRRIIPPTTIIOONN
  12.      These routines allow C programs to make procedure calls on
  13.      other machines across the network.  First, the client calls
  14.      a procedure to send a data packet to the server.  Upon
  15.      receipt of the packet, the server calls a dispatch routine
  16.      to perform the requested service, and then sends back a
  17.      reply.  Finally, the procedure call returns to the client.
  18.  
  19.      ##iinncclluuddee <<rrppcc//rrppcc..hh>>
  20.  
  21.      vvooiidd
  22.      aauutthh__ddeessttrrooyy((aauutthh))
  23.      AAUUTTHH **aauutthh;;
  24.  
  25.           A macro that destroys the authentication information
  26.           associated with aauutthh.  Destruction usually involves
  27.           deallocation of private data structures. The use of
  28.           aauutthh is undefined after calling aauutthh__ddeessttrrooyy.
  29.  
  30.      AAUUTTHH **
  31.      aauutthhnnoonnee__ccrreeaattee(())
  32.  
  33.           Creates and returns an RPC authentication handle that
  34.           passes nonusable authentication information with each
  35.           remote procedure call. This is the default authentica-
  36.           tion used by RPC.
  37.  
  38.      AAUUTTHH **
  39.      aauutthhuunniixx__ccrreeaattee((hhoosstt,, uuiidd,, ggiidd,, lleenn,, aauupp__ggiiddss))
  40.      cchhaarr **hhoosstt;;
  41.      iinntt uuiidd,, ggiidd,, lleenn,, **aauupp..ggiiddss;;
  42.  
  43.           Creates and returns an RPC authentication handle that
  44.           contains authentication information.  The parameter
  45.           hhoosstt is the name of the machine on which the informa-
  46.           tion was created; uuiidd is the user's user ID ; ggiidd is
  47.           the user's current group ID ; lleenn and aauupp__ggiiddss refer to
  48.           a counted array of groups to which the user belongs.
  49.           It is easy to impersonate a user.
  50.  
  51.      AAUUTTHH **
  52.      aauutthhuunniixx__ccrreeaattee__ddeeffaauulltt(())
  53.  
  54.           Calls aauutthhuunniixx__ccrreeaattee with the appropriate parameters.
  55.  
  56.      ccaallllrrppcc((hhoosstt,, pprrooggnnuumm,, vveerrssnnuumm,, pprrooccnnuumm,, iinnpprroocc,, iinn,, oouuttpprroocc,, oouutt))
  57.      cchhaarr **hhoosstt;;
  58.      uu__lloonngg pprrooggnnuumm,, vveerrssnnuumm,, pprrooccnnuumm;;
  59.      cchhaarr **iinn,, **oouutt;;
  60.  
  61.  
  62.  
  63. Sprite v1.0              3 November 1987                        1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. RPC                   C Library Procedures                    RPC
  71.  
  72.  
  73.  
  74.      xxddrrpprroocc__tt iinnpprroocc,, oouuttpprroocc;;
  75.  
  76.           Calls the remote procedure associated with pprrooggnnuumm,
  77.           vveerrssnnuumm, and pprrooccnnuumm on the machine, hhoosstt.  The parame-
  78.           ter iinn is the address of the procedure's argument(s),
  79.           and oouutt is the address of where to place the result(s);
  80.           iinnpprroocc is used to encode the procedure's parameters,
  81.           and oouuttpprroocc is used to decode the procedure's results.
  82.           This routine returns zero if it succeeds, or the value
  83.           of eennuumm ccllnntt__ssttaatt cast to an integer if it fails.  The
  84.           routine ccllnntt__ppeerrrrnnoo is handy for translating failure
  85.           statuses into messages.
  86.  
  87.           Warning: calling remote procedures with this routine
  88.           uses UDP/IP as a transport; see ccllnnttuuddpp__ccrreeaattee for res-
  89.           trictions.  You do not have control of timeouts or
  90.           authentication using this routine.
  91.  
  92.      eennuumm ccllnntt__ssttaatt
  93.      ccllnntt__bbrrooaaddccaasstt((pprrooggnnuumm,, vveerrssnnuumm,, pprrooccnnuumm,, iinnpprroocc,, iinn,, oouuttpprroocc,, oouutt,, eeaacchhrreessuulltt))
  94.      uu__lloonngg pprrooggnnuumm,, vveerrssnnuumm,, pprrooccnnuumm;;
  95.      cchhaarr **iinn,, **oouutt;;
  96.      xxddrrpprroocc__tt iinnpprroocc,, oouuttpprroocc;;
  97.      rreessuullttpprroocc__tt eeaacchhrreessuulltt;;
  98.  
  99.           Like ccaallllrrppcc, except the call message is broadcast to
  100.           all locally connected broadcast nets. Each time it
  101.           receives a response, this routine calls eeaacchhrreessuulltt,
  102.           whose form is:
  103.                eeaacchhrreessuulltt((oouutt,, aaddddrr))
  104.                cchhaarr **oouutt;;
  105.                ssttrruucctt ssoocckkaaddddrr__iinn **aaddddrr;;
  106.  
  107.           where oouutt is the same as oouutt passed to ccllnntt__bbrrooaaddccaasstt,
  108.           except that the remote procedure's output is decoded
  109.           there; aaddddrr points to the address of the machine that
  110.           sent the results.  If eeaacchhrreessuulltt returns zero,
  111.           ccllnntt__bbrrooaaddccaasstt waits for more replies; otherwise it
  112.           returns with appropriate status.
  113.  
  114.           Warning: broadcast sockets are limited in size to the
  115.           maximum transfer unit of the data link. For ethernet,
  116.           this value is 1500 bytes.
  117.  
  118.      eennuumm ccllnntt__ssttaatt
  119.      ccllnntt__ccaallll((ccllnntt,, pprrooccnnuumm,, iinnpprroocc,, iinn,, oouuttpprroocc,, oouutt,, ttoouutt))
  120.      CCLLIIEENNTT **ccllnntt;; uu__lloonngg pprrooccnnuumm;;
  121.      xxddrrpprroocc__tt iinnpprroocc,, oouuttpprroocc;;
  122.      cchhaarr **iinn,, **oouutt;;
  123.      ssttrruucctt ttiimmeevvaall ttoouutt;;
  124.  
  125.           A macro that calls the remote procedure pprrooccnnuumm
  126.  
  127.  
  128.  
  129. Sprite v1.0              3 November 1987                        2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. RPC                   C Library Procedures                    RPC
  137.  
  138.  
  139.  
  140.           associated with the client handle, ccllnntt, which is
  141.           obtained with an RPC client creation routine such as
  142.           ccllnntt__ccrreeaattee.  The parameter iinn is the address of the
  143.           procedure's argument(s), and oouutt is the address of
  144.           where to place the result(s); iinnpprroocc is used to encode
  145.           the procedure's parameters, and oouuttpprroocc is used to
  146.           decode the procedure's results; ttoouutt is the time
  147.           allowed for results to come back.
  148.  
  149.      ccllnntt__ddeessttrrooyy((ccllnntt))
  150.      CCLLIIEENNTT **ccllnntt;;
  151.  
  152.           A macro that destroys the client's RPC handle. Destruc-
  153.           tion usually involves deallocation of private data
  154.           structures, including ccllnntt itself.  Use of ccllnntt is
  155.           undefined after calling ccllnntt__ddeessttrrooyy.  If the RPC
  156.           library opened the associated socket, it will close it
  157.           also.  Otherwise, the socket remains open.
  158.  
  159.      CCLLIIEENNTT **
  160.      ccllnntt__ccrreeaattee ((hhoosstt,, pprroogg,, vveerrss,, pprroottoo))
  161.      cchhaarr **hhoosstt;;
  162.      uu__lloonngg pprroogg,, vveerrss;;
  163.      cchhaarr **pprroottoo;;
  164.  
  165.           Generic client creation routine.  hhoosstt identifies the
  166.           name of the remote host where the server is located.
  167.           pprroottoo indicates which kind of transport protocol to
  168.           use. The currently supported values for this field are
  169.           ``udp'' and ``tcp''.  Default timeouts are set, but can
  170.           be modified using ccllnntt__ccoonnttrrooll..
  171.  
  172.           Warning: Using UDP has its shortcomings.  Since UDP-
  173.           based RPC messages can only hold up to 8 Kbytes of
  174.           encoded data, this transport cannot be used for pro-
  175.           cedures that take large arguments or return huge
  176.           results.
  177.  
  178.      bbooooll__tt
  179.      ccllnntt__ccoonnttrrooll((ccll,, rreeqq,, iinnffoo))
  180.      CCLLIIEENNTT **ccll;;
  181.      cchhaarr **iinnffoo;;
  182.  
  183.           A macro used to change or retrieve various information
  184.           about a client object.  rreeqq indicates the type of
  185.           operation, and iinnffoo is a pointer to the information.
  186.           For both UDP and TCP, the supported values of rreeqq and
  187.           their argument types and what they do are:
  188.           CLSET_TIMEOUT       struct timeval      set total timeout
  189.           CLGET_TIMEOUT       struct timeval      get total timeout
  190.  
  191.           Note: if you set the timeout using ccllnntt__ccoonnttrrooll, the
  192.  
  193.  
  194.  
  195. Sprite v1.0              3 November 1987                        3
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. RPC                   C Library Procedures                    RPC
  203.  
  204.  
  205.  
  206.           timeout parameter passed to ccllnntt__ccaallll will be ignored
  207.           in all future calls.
  208.           CLGET_SERVER_ADDR   struct sockaddr     get server's address
  209.           The following operations are valid for UDP only:
  210.           CLSET_RETRY_TIMEOUT struct timevalset the retry timeout
  211.           CLGET_RETRY_TIMEOUT struct timevalget the retry timeout
  212.           The retry timeout is the time that UDP RPC waits for
  213.           the server to reply before retransmitting the request.
  214.  
  215.      ccllnntt__ffrreeeerreess((ccllnntt,, oouuttpprroocc,, oouutt))
  216.      CCLLIIEENNTT **ccllnntt;;
  217.      xxddrrpprroocc__tt oouuttpprroocc;;
  218.      cchhaarr **oouutt;;
  219.  
  220.           A macro that frees any data allocated by the RPC/XDR
  221.           system when it decoded the results of an RPC call.  The
  222.           parameter oouutt is the address of the results, and
  223.           oouuttpprroocc is the XDR routine describing the results in
  224.           simple primitives.  This routine returns one if the
  225.           results were successfully freed, and zero otherwise.
  226.  
  227.      vvooiidd
  228.      ccllnntt__ggeetteerrrr((ccllnntt,, eerrrrpp))
  229.      CCLLIIEENNTT **ccllnntt;;
  230.      ssttrruucctt rrppcc__eerrrr **eerrrrpp;;
  231.  
  232.           A macro that copies the error structure out of the
  233.           client handle to the structure at address eerrrrpp.
  234.  
  235.      vvooiidd
  236.      ccllnntt__ppccrreeaatteeeerrrroorr((ss))
  237.      cchhaarr **ss;;
  238.  
  239.           Prints a message to standard error indicating why a
  240.           client RPC handle could not be created.  The message is
  241.           prepended with string ss and a colon.  Used when a
  242.           ccllnntt__ccrreeaattee, ccllnnttrraaww__ccrreeaattee, ccllnnttttccpp__ccrreeaattee, or
  243.           ccllnnttuuddpp__ccrreeaattee call fails.
  244.  
  245.      vvooiidd
  246.      ccllnntt__ppeerrrrnnoo((ssttaatt))
  247.      eennuumm ccllnntt__ssttaatt ssttaatt;;
  248.  
  249.           Prints a message to standard error corresponding to the
  250.           condition indicated by ssttaatt.  Used after ccaallllrrppcc.
  251.  
  252.      ccllnntt__ppeerrrroorr((ccllnntt,, ss))
  253.      CCLLIIEENNTT **ccllnntt;;
  254.      cchhaarr **ss;;
  255.  
  256.           Prints a message to standard error indicating why an
  257.           RPC call failed; ccllnntt is the handle used to do the
  258.  
  259.  
  260.  
  261. Sprite v1.0              3 November 1987                        4
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. RPC                   C Library Procedures                    RPC
  269.  
  270.  
  271.  
  272.           call.  The message is prepended with string ss and a
  273.           colon.  Used after ccllnntt__ccaallll.
  274.  
  275.      cchhaarr **
  276.      ccllnntt__ssppccrreeaatteeeerrrroorr
  277.      cchhaarr **ss;;
  278.  
  279.           Like ccllnntt__ppccrreeaatteeeerrrroorr, except that it returns a string
  280.           instead of printing to the standard error.
  281.  
  282.           Bugs: returns pointer to static data that is overwrit-
  283.           ten on each call.
  284.  
  285.      cchhaarr **
  286.      ccllnntt__ssppeerrrrnnoo((ssttaatt))
  287.      eennuumm ccllnntt__ssttaatt ssttaatt;;
  288.  
  289.           Takes the same arguments as ccllnntt__ppeerrrrnnoo, but instread
  290.           of sending a message to the standard error indicating
  291.           why an RPC call failed, it returns a pointer to a
  292.           string which contains the message.  The string ends
  293.           with a newline.
  294.  
  295.           ccllnntt__ssppeerrrrnnoo is used instead of ccllnntt__ppeerrrrnnoo if the pro-
  296.           gram doesn't have a standard error (as a program run-
  297.           ning as a server quite likely doesn't), or if the pro-
  298.           grammer doesn't want the message to be output with
  299.           pprriinnttff, or if a message format different than that sup-
  300.           ported by ccllnntt__ppeerrrrnnoo is to be used.  Note: unlike
  301.           ccllnntt__ssppeerrrroorr and ccllnntt__ssppccrreeaatteerrrroorr, ccllnntt__ssppeerrrrnnoo does
  302.           not return pointer to static data so the result will
  303.           not get overwritten on each call.
  304.  
  305.      cchhaarr **
  306.      ccllnntt__ssppeerrrroorr((rrppcchh,, ss))
  307.      CCLLIIEENNTT **rrppcchh;;
  308.      cchhaarr **ss;;
  309.  
  310.           Like ccllnntt__ppeerrrroorr, except that (like ccllnntt__ssppeerrrrnnoo) it
  311.           returns a string instead of printing to standard error.
  312.  
  313.           Bugs: returns pointer to static data that is overwrit-
  314.           ten on each call.
  315.  
  316.      CCLLIIEENNTT **
  317.      ccllnnttrraaww__ccrreeaattee((pprrooggnnuumm,, vveerrssnnuumm))
  318.      uu__lloonngg pprrooggnnuumm,, vveerrssnnuumm;;
  319.  
  320.           This routine creates a toy RPC client for the remote
  321.           program pprrooggnnuumm, version vveerrssnnuumm.  The transport used
  322.           to pass messages to the service is actually a buffer
  323.           within the process's address space, so the
  324.  
  325.  
  326.  
  327. Sprite v1.0              3 November 1987                        5
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. RPC                   C Library Procedures                    RPC
  335.  
  336.  
  337.  
  338.           corresponding RPC server should live in the same
  339.           address space; see ssvvccrraaww__ccrreeaattee.  This allows simula-
  340.           tion of RPC and acquisition of RPC overheads, such as
  341.           round trip times, without any kernel interference. This
  342.           routine returns NULL if it fails.
  343.  
  344.      CCLLIIEENNTT **
  345.      ccllnnttttccpp__ccrreeaattee((aaddddrr,, pprrooggnnuumm,, vveerrssnnuumm,, ssoocckkpp,, sseennddsszz,, rreeccvvsszz))
  346.      ssttrruucctt ssoocckkaaddddrr__iinn **aaddddrr;;
  347.      uu__lloonngg pprrooggnnuumm,, vveerrssnnuumm;;
  348.      iinntt **ssoocckkpp;;
  349.      uu__iinntt sseennddsszz,, rreeccvvsszz;;
  350.  
  351.           This routine creates an RPC client for the remote pro-
  352.           gram pprrooggnnuumm, version vveerrssnnuumm; the client uses TCP/IP
  353.           as a transport. The remote program is located at Inter-
  354.           net address **aaddddrr.  If aaddddrr-->>ssiinn__ppoorrtt is zero, then it
  355.           is set to the actual port that the remote program is
  356.           listening on (the remote ppoorrttmmaapp service is consulted
  357.           for this information). The parameter ssoocckkpp is a socket;
  358.           if it is RRPPCC__AANNYYSSOOCCKK, then this routine opens a new one
  359.           and sets ssoocckkpp.  Since TCP-based RPC uses buffered I/O
  360.           , the user may specify the size of the send and receive
  361.           buffers with the parameters sseennddsszz and rreeccvvsszz; values
  362.           of zero choose suitable defaults.  This routine returns
  363.           NULL if it fails.
  364.  
  365.      CCLLIIEENNTT **
  366.      ccllnnttuuddpp__ccrreeaattee((aaddddrr,, pprroonnuumm,, vveerrssnnuumm,, wwaaiitt,, ssoocckkpp))
  367.      ssttrruucctt ssoocckkaaddddrr__iinn **aaddddrr;;
  368.      uu__lloonngg pprrooggnnuumm,, vveerrssnnuumm;;
  369.      ssttrruucctt ttiimmeevvaall wwaaiitt;;
  370.      iinntt **ssoocckkpp;;
  371.  
  372.           This routine creates an RPC client for the remote pro-
  373.           gram pprrooggnnuumm, version vveerrssnnuumm; the client uses use
  374.           UDP/IP as a transport. The remote program is located at
  375.           Internet address aaddddrr.  If aaddddrr-->>ssiinn__ppoorrtt is zero, then
  376.           it is set to actual port that the remote program is
  377.           listening on (the remote ppoorrttmmaapp service is consulted
  378.           for this information). The parameter ssoocckkpp is a socket;
  379.           if it is RRPPCC__AANNYYSSOOCCKK , then this routine opens a new
  380.           one and sets ssoocckkpp.  The UDP transport resends the call
  381.           message in intervals of wwaaiitt time until a response is
  382.           received or until the call times out.  The total time
  383.           for the call to time out is specified by ccllnntt__ccaallll.
  384.  
  385.           Warning: since UDP-based RPC messages can only hold up
  386.           to 8 Kbytes of encoded data, this transport cannot be
  387.           used for procedures that take large arguments or return
  388.           huge results.
  389.  
  390.  
  391.  
  392.  
  393. Sprite v1.0              3 November 1987                        6
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. RPC                   C Library Procedures                    RPC
  401.  
  402.  
  403.  
  404.      vvooiidd
  405.      ggeett__mmyyaaddddrreessss((aaddddrr))
  406.      ssttrruucctt ssoocckkaaddddrr__iinn **aaddddrr;;
  407.  
  408.           Stuffs the machine's IP address into **aaddddrr, without
  409.           consulting the library routines that deal with
  410.           //eettcc//hhoossttss.  The port number is always set to hhttoonnss(
  411.           PMAPPORT ).
  412.  
  413.      ssttrruucctt ppmmaapplliisstt **
  414.      ppmmaapp__ggeettmmaappss((aaddddrr))
  415.      ssttrruucctt ssoocckkaaddddrr__iinn **aaddddrr;;
  416.  
  417.           A user interface to the ppoorrttmmaapp service, which returns
  418.           a list of the current RPC program-to-port mappings on
  419.           the host located at IP address **aaddddrr.  This routine can
  420.           return NULL . The command rrppcciinnffoo --pp uses this routine.
  421.  
  422.      uu__sshhoorrtt
  423.      ppmmaapp__ggeettppoorrtt((aaddddrr,, pprrooggnnuumm,, vveerrssnnuumm,, pprroottooccooll))
  424.      ssttrruucctt ssoocckkaaddddrr__iinn **aaddddrr;;
  425.      uu__lloonngg pprrooggnnuumm,, vveerrssnnuumm,, pprroottooccooll;;
  426.  
  427.           A user interface to the ppoorrttmmaapp service, which returns
  428.           the port number on which waits a service that supports
  429.           program number pprrooggnnuumm, version vveerrssnnuumm, and speaks the
  430.           transport protocol associated with pprroottooccooll.  The value
  431.           of pprroottooccooll is most likely IIPPPPRROOTTOO__UUDDPP or IIPPPPRROOTTOO__TTCCPP.
  432.           A return value of zero means that the mapping does not
  433.           exist or that the RPC system failured to contact the
  434.           remote ppoorrttmmaapp service.  In the latter case, the global
  435.           variable rrppcc__ccrreeaatteeeerrrr contains the RPC status.
  436.  
  437.      eennuumm ccllnntt__ssttaatt
  438.      ppmmaapp__rrmmttccaallll((aaddddrr,, pprrooggnnuumm,, vveerrssnnuumm,, pprrooccnnuumm,, iinnpprroocc,, iinn,, oouuttpprroocc,, oouutt,, ttoouutt,, ppoorrttpp))
  439.      ssttrruucctt ssoocckkaaddddrr__iinn **aaddddrr;;
  440.      uu__lloonngg pprrooggnnuumm,, vveerrssnnuumm,, pprrooccnnuumm;;
  441.      cchhaarr **iinn,, **oouutt;;
  442.      xxddrrpprroocc__tt iinnpprroocc,, oouuttpprroocc;;
  443.      ssttrruucctt ttiimmeevvaall ttoouutt;;
  444.      uu__lloonngg **ppoorrttpp;;
  445.  
  446.           A user interface to the ppoorrttmmaapp service, which
  447.           instructs ppoorrttmmaapp on the host at IP address **aaddddrr to
  448.           make an RPC call on your behalf to a procedure on that
  449.           host.  The parameter **ppoorrttpp will be modified to the
  450.           program's port number if the procedure succeeds. The
  451.           definitions of other parameters are discussed in
  452.           ccaallllrrppcc and ccllnntt__ccaallll.  This procedure should be used
  453.           for a ``ping'' and nothing else.  See also
  454.           ccllnntt__bbrrooaaddccaasstt.
  455.  
  456.  
  457.  
  458.  
  459. Sprite v1.0              3 November 1987                        7
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. RPC                   C Library Procedures                    RPC
  467.  
  468.  
  469.  
  470.      ppmmaapp__sseett((pprrooggnnuumm,, vveerrssnnuumm,, pprroottooccooll,, ppoorrtt))
  471.      uu__lloonngg pprrooggnnuumm,, vveerrssnnuumm,, pprroottooccooll;;
  472.      uu__sshhoorrtt ppoorrtt;;
  473.  
  474.           A user interface to the ppoorrttmmaapp service, which estab-
  475.           lishes a mapping between the triple
  476.           [pprrooggnnuumm,,vveerrssnnuumm,,pprroottooccooll] and ppoorrtt on the machine's
  477.           ppoorrttmmaapp service. The value of pprroottooccooll is most likely
  478.           IIPPPPRROOTTOO__UUDDPP or IIPPPPRROOTTOO__TTCCPP.  This routine returns one
  479.           if it succeeds, zero otherwise.  Automatically done by
  480.           ssvvcc__rreeggiisstteerr.
  481.  
  482.      ppmmaapp__uunnsseett((pprrooggnnuumm,, vveerrssnnuumm))
  483.      uu__lloonngg pprrooggnnuumm,, vveerrssnnuumm;;
  484.  
  485.           A user interface to the ppoorrttmmaapp service, which destroys
  486.           all mapping between the triple [pprrooggnnuumm,, vveerrssnnuumm,, **]
  487.           and ppoorrttss on the machine's ppoorrttmmaapp service. This rou-
  488.           tine returns one if it succeeds, zero otherwise.
  489.  
  490.      rreeggiisstteerrrrppcc((pprrooggnnuumm,, vveerrssnnuumm,, pprrooccnnuumm,, pprrooccnnaammee,, iinnpprroocc,, oouuttpprroocc))
  491.      uu__lloonngg pprrooggnnuumm,, vveerrssnnuumm,, pprrooccnnuumm;;
  492.      cchhaarr **((**pprrooccnnaammee)) (()) ;;
  493.      xxddrrpprroocc__tt iinnpprroocc,, oouuttpprroocc;;
  494.  
  495.           Registers procedure pprrooccnnaammee with the RPC service pack-
  496.           age.  If a request arrives for program pprrooggnnuumm, version
  497.           vveerrssnnuumm, and procedure pprrooccnnuumm, pprrooccnnaammee is called with
  498.           a pointer to its parameter(s); pprrooggnnaammee should return a
  499.           pointer to its static result(s); iinnpprroocc is used to
  500.           decode the parameters while oouuttpprroocc is used to encode
  501.           the results.  This routine returns zero if the regis-
  502.           tration succeeded, -1 otherwise.
  503.  
  504.           Warning: remote procedures registered in this form are
  505.           accessed using the UDP/IP transport; see ssvvccuuddpp__ccrreeaattee
  506.           for restrictions.
  507.  
  508.      ssttrruucctt rrppcc__ccrreeaatteeeerrrr     rrppcc__ccrreeaatteeeerrrr;;
  509.  
  510.           A global variable whose value is set by any RPC client
  511.           creation routine that does not succeed.  Use the rou-
  512.           tine ccllnntt__ppccrreeaatteeeerrrroorr to print the reason why.
  513.  
  514.      ssvvcc__ddeessttrrooyy((xxpprrtt))
  515.      SSVVCCXXPPRRTT ** xxpprrtt;;
  516.  
  517.           A macro that destroys the RPC service transport handle,
  518.           xxpprrtt.  Destruction usually involves deallocation of
  519.           private data structures, including xxpprrtt itself.  Use of
  520.           xxpprrtt is undefined after calling this routine.
  521.  
  522.  
  523.  
  524.  
  525. Sprite v1.0              3 November 1987                        8
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. RPC                   C Library Procedures                    RPC
  533.  
  534.  
  535.  
  536.      ffdd__sseett ssvvcc__ffddsseett;;
  537.  
  538.           A global variable reflecting the RPC service side's
  539.           read file descriptor bit mask; it is suitable as a
  540.           parameter to the sseelleecctt system call. This is only of
  541.           interest if a service implementor does not call
  542.           ssvvcc__rruunn, but rather does his own asynchronous event
  543.           processing.  This variable is read-only (do not pass
  544.           its address to sseelleecctt!), yet it may change after calls
  545.           to ssvvcc__ggeettrreeqqsseett or any creation routines.
  546.  
  547.      iinntt ssvvcc__ffddss;;
  548.  
  549.           Similar to ssvvcc__ffeeddsseett, but limited to 32 descriptors.
  550.           This interface is obsoleted by ssvvcc__ffddsseett.
  551.  
  552.      ssvvcc__ffrreeeeaarrggss((xxpprrtt,, iinnpprroocc,, iinn))
  553.      SSVVCCXXPPRRTT **xxpprrtt;;
  554.      xxddrrpprroocc__tt iinnpprroocc;;
  555.      cchhaarr **iinn;;
  556.  
  557.           A macro that frees any data allocated by the RPC/XDR
  558.           system when it decoded the arguments to a service pro-
  559.           cedure using ssvvcc__ggeettaarrggss.  This routine returns one if
  560.           the results were successfully freed, and zero other-
  561.           wise.
  562.  
  563.      ssvvcc__ggeettaarrggss((xxpprrtt,, iinnpprroocc,, iinn))
  564.      SSVVCCXXPPRRTT **xxpprrtt;;
  565.      xxddrrpprroocc__tt iinnpprroocc;;
  566.      cchhaarr **iinn;;
  567.  
  568.           A macro that decodes the arguments of an RPC request
  569.           associated with the RPC service transport handle, xxpprrtt
  570.           .. The parameter iinn is the address where the arguments
  571.           will be placed; iinnpprroocc is the XDR routine used to
  572.           decode the arguments.  This routine returns one if
  573.           decoding succeeds, and zero otherwise.
  574.  
  575.      ssttrruucctt ssoocckkaaddddrr__iinn
  576.      ssvvcc__ggeettccaalllleerr((xxpprrtt))
  577.      SSVVCCXXPPRRTT **xxpprrtt;;
  578.  
  579.           The approved way of getting the network address of the
  580.           caller of a procedure associated with the RPC service
  581.           transport handle, xxpprrtt.
  582.  
  583.      ssvvcc__ggeettrreeqqsseett((rrddffddss))
  584.      ffdd__sseett **rrddffddss;;
  585.  
  586.           This routine is only of interest if a service implemen-
  587.           tor does not call ssvvcc__rruunn, but instead implements
  588.  
  589.  
  590.  
  591. Sprite v1.0              3 November 1987                        9
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598. RPC                   C Library Procedures                    RPC
  599.  
  600.  
  601.  
  602.           custom asynchronous event processing.  It is called
  603.           when the sseelleecctt system call has determined that an RPC
  604.           request has arrived on some RPC socket(s); rrddffddss is the
  605.           resultant read file descriptor bit mask.  The routine
  606.           returns when all sockets associated with the value of
  607.           rrddffddss have been serviced.
  608.  
  609.      ssvvcc__ggeettrreeqq((rrddffddss))
  610.      iinntt rrddffddss;;
  611.  
  612.           Similar to ssvvcc__ggeettrreeqqsseett, but limited to 32 descrip-
  613.           tors. This interface is obsoleted by ssvvcc__ggeettrreeqqsseett.
  614.  
  615.      ssvvcc__rreeggiisstteerr((xxpprrtt,, pprrooggnnuumm,, vveerrssnnuumm,, ddiissppaattcchh,, pprroottooccooll))
  616.      SSVVCCXXPPRRTT **xxpprrtt;;
  617.      uu__lloonngg pprrooggnnuumm,, vveerrssnnuumm;;
  618.      vvooiidd ((**ddiissppaattcchh)) (());;
  619.      uu__lloonngg pprroottooccooll;;
  620.  
  621.           Associates pprrooggnnuumm and vveerrssnnuumm with the service
  622.           dispatch procedure, ddiissppaattcchh.  If pprroottooccooll is zero, the
  623.           service is not registered with the ppoorrttmmaapp service.  If
  624.           pprroottooccooll is non-zero, then a mapping of the triple
  625.           [pprrooggnnuumm,, vveerrssnnuumm,, pprroottooccooll] to xxpprrtt-->>xxpp__ppoorrtt is esta-
  626.           blished with the local ppoorrttmmaapp service (generally pprroo--
  627.           ttooccooll is zero, IIPPPPRROOTTOO__UUDDPP or IIPPPPRROOTTOO__TTCCPP ).  The pro-
  628.           cedure ddiissppaattcchh has the following form:
  629.                ddiissppaattcchh((rreeqquueesstt,, xxpprrtt))
  630.                ssttrruucctt ssvvcc__rreeqq **rreeqquueesstt;;
  631.                SSVVCCXXPPRRTT **xxpprrtt;;
  632.  
  633.           The ssvvcc__rreeggiisstteerr routine returns one if it succeeds,
  634.           and zero otherwise.
  635.  
  636.      ssvvcc__rruunn(())
  637.  
  638.           This routine never returns. It waits for RPC requests
  639.           to arrive, and calls the appropriate service procedure
  640.           using ssvvcc__ggeettrreeqq when one arrives. This procedure is
  641.           usually waiting for a sseelleecctt system call to return.
  642.  
  643.      ssvvcc__sseennddrreeppllyy((xxpprrtt,, oouuttpprroocc,, oouutt))
  644.      SSVVCCXXPPRRTT **xxpprrtt;;
  645.      xxddrrpprroocc__tt oouuttpprroocc;;
  646.      cchhaarr **oouutt;;
  647.  
  648.           Called by an RPC service's dispatch routine to send the
  649.           results of a remote procedure call.  The parameter xxpprrtt
  650.           is the request's associated transport handle; oouuttpprroocc
  651.           is the XDR routine which is used to encode the results;
  652.           and oouutt is the address of the results.  This routine
  653.           returns one if it succeeds, zero otherwise.
  654.  
  655.  
  656.  
  657. Sprite v1.0              3 November 1987                       10
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664. RPC                   C Library Procedures                    RPC
  665.  
  666.  
  667.  
  668.      vvooiidd
  669.      ssvvcc__uunnrreeggiisstteerr((pprrooggnnuumm,, vveerrssnnuumm))
  670.      uu__lloonngg pprrooggnnuumm,, vveerrssnnuumm;;
  671.  
  672.           Removes all mapping of the double [pprrooggnnuumm,, vveerrssnnuumm] to
  673.           dispatch routines, and of the triple [pprrooggnnuumm,, vveerrssnnuumm,,
  674.           **] to port number.
  675.  
  676.      vvooiidd
  677.      ssvvcceerrrr__aauutthh((xxpprrtt,, wwhhyy))
  678.      SSVVCCXXPPRRTT **xxpprrtt;;
  679.      eennuumm aauutthh__ssttaatt wwhhyy;;
  680.  
  681.           Called by a service dispatch routine that refuses to
  682.           perform a remote procedure call due to an authentica-
  683.           tion error.
  684.  
  685.      vvooiidd
  686.      ssvvcceerrrr__ddeeccooddee((xxpprrtt))
  687.      SSVVCCXXPPRRTT **xxpprrtt;;
  688.  
  689.           Called by a service dispatch routine that can't suc-
  690.           cessfully decode its parameters. See also ssvvcc__ggeettaarrggss.
  691.  
  692.      vvooiidd
  693.      ssvvcceerrrr__nnoopprroocc((xxpprrtt))
  694.      SSVVCCXXPPRRTT **xxpprrtt;;
  695.  
  696.           Called by a service dispatch routine that doesn't
  697.           implement the procedure number that the caller
  698.           requests.
  699.  
  700.      vvooiidd
  701.      ssvvcceerrrr__nnoopprroogg((xxpprrtt))
  702.      SSVVCCXXPPRRTT **xxpprrtt;;
  703.  
  704.           Called when the desired program is not registered with
  705.           the RPC package. Service implementors usually don't
  706.           need this routine.
  707.  
  708.      vvooiidd
  709.      ssvvcceerrrr__pprrooggvveerrss((xxpprrtt))
  710.      SSVVCCXXPPRRTT **xxpprrtt;;
  711.  
  712.           Called when the desired version of a program is not
  713.           registered with the RPC package. Service implementors
  714.           usually don't need this routine.
  715.  
  716.      vvooiidd
  717.      ssvvcceerrrr__ssyysstteemmeerrrr((xxpprrtt))
  718.      SSVVCCXXPPRRTT **xxpprrtt;;
  719.  
  720.  
  721.  
  722.  
  723. Sprite v1.0              3 November 1987                       11
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. RPC                   C Library Procedures                    RPC
  731.  
  732.  
  733.  
  734.           Called by a service dispatch routine when it detects a
  735.           system error not covered by any particular protocol.
  736.           For example, if a service can no longer allocate
  737.           storage, it may call this routine.
  738.  
  739.      vvooiidd
  740.      ssvvcceerrrr__wweeaakkaauutthh((xxpprrtt))
  741.      SSVVCCXXPPRRTT **xxpprrtt;;
  742.  
  743.           Called by a service dispatch routine that refuses to
  744.           perform a remote procedure call due to insufficient
  745.           (but correct) authentication parameters.  The routine
  746.           calls ssvvcceerrrr__aauutthh((xxpprrtt,, AAUUTTHH__TTOOOOWWEEAAKK ) .
  747.  
  748.      SSVVCCXXPPRRTT **
  749.      ssvvccrraaww__ccrreeaattee(())
  750.  
  751.           This routine creates a toy RPC service transport, to
  752.           which it returns a pointer.  The transport is really a
  753.           buffer within the process's address space, so the
  754.           corresponding RPC client should live in the same
  755.           address space; see ccllnnttrraaww__ccrreeaattee.  This routine allows
  756.           simulation of RPC and acquisition of RPC overheads
  757.           (such as round trip times), without any kernel
  758.           interference. This routine returns NULL if it fails.
  759.  
  760.      SSVVCCXXPPRRTT **
  761.      ssvvccttccpp__ccrreeaattee((ssoocckk,, sseenndd__bbuuff__ssiizzee,, rreeccvv__bbuuff__ssiizzee))
  762.      iinntt ssoocckk;;
  763.      uu__iinntt sseenndd__bbuuff__ssiizzee,, rreeccvv__bbuuff__ssiizzee;;
  764.  
  765.           This routine creates a TCP/IP-based RPC service tran-
  766.           sport, to which it returns a pointer.  The transport is
  767.           associated with the socket ssoocckk, which may be
  768.           RRPPCC__AANNYYSSOOCCKK ,, in which case a new socket is created.
  769.           If the socket is not bound to a local TCP port, then
  770.           this routine binds it to an arbitrary port. Upon com-
  771.           pletion, xxpprrtt-->>xxpp__ssoocckk is the transport's socket
  772.           number, and xxpprrtt-->>xxpp__ppoorrtt is the transport's port
  773.           number.  This routine returns NULL if it fails. Since
  774.           TCP-based RPC uses buffered I/O , users may specify the
  775.           size of buffers; values of zero choose suitable
  776.           defaults.
  777.  
  778.      vvooiidd
  779.      ssvvccffdd__ccrreeaattee((ffdd,, sseennssiizzee,, rreeccvvssiizzee))
  780.      iinntt ffdd;;
  781.      uu__iinntt sseennddssiizzee;;
  782.      uu__iinntt rreeccvvssiizzee;;
  783.  
  784.           Creates a service on top of any open desciptor. Typi-
  785.           cally, this descriptor is a connected socket for a
  786.  
  787.  
  788.  
  789. Sprite v1.0              3 November 1987                       12
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796. RPC                   C Library Procedures                    RPC
  797.  
  798.  
  799.  
  800.           stream protocol such as TCP . sseennddssiizzee and rreeccvvssiizzee
  801.           indicate sizes for the send and receive buffers.  If
  802.           they are zero, a reasonable default is chosen.
  803.  
  804.      SSVVCCXXPPRRTT **
  805.      ssvvccuuddpp__ccrreeaattee((ssoocckk))
  806.      iinntt ssoocckk;;
  807.  
  808.           This routine creates a UDP/IP-based RPC service tran-
  809.           sport, to which it returns a pointer.  The transport is
  810.           associated with the socket ssoocckk, which may be
  811.           RRPPCC__AANNYYSSOOCCKK ,, in which case a new socket is created.
  812.           If the socket is not bound to a local UDP port, then
  813.           this routine binds it to an arbitrary port. Upon com-
  814.           pletion, xxpprrtt-->>xxpp__ssoocckk is the transport's socket
  815.           number, and xxpprrtt-->>xxpp__ppoorrtt is the transport's port
  816.           number.  This routine returns NULL if it fails.
  817.  
  818.           Warning: since UDP-based RPC messages can only hold up
  819.           to 8 Kbytes of encoded data, this transport cannot be
  820.           used for procedures that take large arguments or return
  821.           huge results.
  822.  
  823.      xxddrr__aacccceepptteedd__rreeppllyy((xxddrrss,, aarr))
  824.      XXDDRR **xxddrrss;;
  825.      ssttrruucctt aacccceepptteedd__rreeppllyy **aarr;;
  826.  
  827.           Used for describing RPC messages, externally. This rou-
  828.           tine is useful for users who wish to generate RPC-style
  829.           messages without using the RPC package.
  830.  
  831.      xxddrr__aauutthhuunniixx__ppaarrmmss((xxddrrss,, aauupppp))
  832.      XXDDRR **xxddrrss;;
  833.      ssttrruucctt aauutthhuunniixx__ppaarrmmss **aauupppp;;
  834.  
  835.           Used for describing UNIX credentials, externally. This
  836.           routine is useful for users who wish to generate these
  837.           credentials without using the RPC authentication pack-
  838.           age.
  839.  
  840.      vvooiidd
  841.      xxddrr__ccaallllhhddrr((xxddrrss,, cchhddrr))
  842.      XXDDRR **xxddrrss;;
  843.      ssttrruucctt rrppcc__mmssgg **cchhddrr;;
  844.  
  845.           Used for describing RPC messages, externally.  This
  846.           routine is useful for users who wish to generate RPC-
  847.           style messages without using the RPC package.
  848.  
  849.      xxddrr__ccaallllmmssgg((xxddrrss,, ccmmssgg))
  850.      XXDDRR **xxddrrss;;
  851.      ssttrruucctt rrppcc__mmssgg **ccmmssgg;;
  852.  
  853.  
  854.  
  855. Sprite v1.0              3 November 1987                       13
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862. RPC                   C Library Procedures                    RPC
  863.  
  864.  
  865.  
  866.           Used for describing RPC messages, externally.  This
  867.           routine is useful for users who wish to generate RPC-
  868.           style messages without using the RPC package.
  869.  
  870.      xxddrr__ooppaaqquuee__aauutthh((xxddrrss,, aapp))
  871.      XXDDRR **xxddrrss;;
  872.      ssttrruucctt ooppaaqquuee__aauutthh **aapp;;
  873.  
  874.           Used for describing RPC messages, externally.  This
  875.           routine is useful for users who wish to generate RPC-
  876.           style messages without using the RPC package.
  877.  
  878.      xxddrr__ppmmaapp((xxddrrss,, rreeggss))
  879.      XXDDRR **xxddrrss;;
  880.      ssttrruucctt ppmmaapp **rreeggss;;
  881.  
  882.           Used for describing parameters to various ppoorrttmmaapp pro-
  883.           cedures, externally.  This routine is useful for users
  884.           who wish to generate these parameters without using the
  885.           ppmmaapp interface.
  886.  
  887.      xxddrr__ppmmaapplliisstt((xxddrrss,, rrpp))
  888.      XXDDRR **xxddrrss;;
  889.      ssttrruucctt ppmmaapplliisstt ****rrpp;;
  890.  
  891.           Used for describing a list of port mappings, exter-
  892.           nally.  This routine is useful for users who wish to
  893.           generate these parameters without using the ppmmaapp inter-
  894.           face.
  895.  
  896.      xxddrr__rreejjeecctteedd__rreeppllyy((xxddrrss,, rrrr))
  897.      XXDDRR **xxddrrss;;
  898.      ssttrruucctt rreejjeecctteedd__rreeppllyy **rrrr;;
  899.  
  900.           Used for describing RPC messages, externally.  This
  901.           routine is useful for users who wish to generate RPC-
  902.           style messages without using the RPC package.
  903.  
  904.      xxddrr__rreeppllyymmssgg((xxddrrss,, rrmmssgg))
  905.      XXDDRR **xxddrrss;;
  906.      ssttrruucctt rrppcc__mmssgg **rrmmssgg;;
  907.  
  908.           Used for describing RPC messages, externally.  This
  909.           routine is useful for users who wish to generate RPC
  910.           style messages without using the RPC package.
  911.  
  912.      vvooiidd
  913.      xxpprrtt__rreeggiisstteerr((xxpprrtt))
  914.      SSVVCCXXPPRRTT **xxpprrtt;;
  915.  
  916.           After RPC service transport handles are created, they
  917.           should register themselves with the RPC service
  918.  
  919.  
  920.  
  921. Sprite v1.0              3 November 1987                       14
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928. RPC                   C Library Procedures                    RPC
  929.  
  930.  
  931.  
  932.           package.  This routine modifies the global variable
  933.           ssvvcc__ffddss.  Service implementors usually don't need this
  934.           routine.
  935.  
  936.      vvooiidd
  937.      xxpprrtt__uunnrreeggiisstteerr((xxpprrtt))
  938.      SSVVCCXXPPRRTT **xxpprrtt;;
  939.  
  940.           Before an RPC service transport handle is destroyed, it
  941.           should unregister itself with the RPC service package.
  942.           This routine modifies the global variable ssvvcc__ffddss.
  943.           Service implementors usually don't need this routine.
  944.  
  945. SSEEEE AALLSSOO
  946.      XXDDRR(3N)
  947.      The following manuals:
  948.           _R_e_m_o_t_e _P_r_o_c_e_d_u_r_e _C_a_l_l_s: _P_r_o_t_o_c_o_l _S_p_e_c_i_f_i_c_a_t_i_o_n
  949.           _R_e_m_o_t_e _P_r_o_c_e_d_u_r_e _C_a_l_l _P_r_o_g_r_a_m_m_i_n_g _G_u_i_d_e
  950.           _r_p_c_g_e_n _P_r_o_g_r_a_m_m_i_n_g _G_u_i_d_e
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987. Sprite v1.0              3 November 1987                       15
  988.  
  989.  
  990.  
  991.